/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package manager;

import entity.Orders;
import iface.IManagerDisabled;
import java.util.ArrayList;

/**
 *
 * @author Noi
 */
public class DisabledOrdersManager implements IManagerDisabled<Orders> {
    
    private Manager manager;
    private ArrayList<Orders> alOrders;
    
    public DisabledOrdersManager(Manager manager) {
        this.manager = manager;
        this.alOrders = new ArrayList<Orders>();
    }
    
    @Override
    public void add(Orders obj) {
        this.alOrders.add(obj);
    }

    @Override
    public void recovery(int index) {
        Orders orders = (Orders)this.alOrders.remove(index);
        orders.setStatus(true);
        this.manager.getOrdersManager().add(orders);
    }

    @Override
    public Orders get(int index) {
        return this.alOrders.get(index);
    }
    
}
